// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.

using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;

namespace RealWorld.Grids
{
    internal static class WebControlHelper
    {
        public static Control RecursiveFindControl(Control namingContainer, string controlId)
        {
            Control c = namingContainer.FindControl(controlId);

            if (c != null)
                return c;

            if (namingContainer.NamingContainer != null)
                return RecursiveFindControl(namingContainer.NamingContainer, controlId);

            return null;
        }
    }
}
